package main

const (
	//=========================================================
	RootTemplate = `<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Image server</title>
</head>
<body>
	<h2> 静态文件服务器: <a href="/files">{{.}}/files</a> </h2>
	<h2> 图片列表: <a href="/list">{{.}}/list</a> </h2>
</body>
</html>
`
	//=========================================================
	ImgListTemplate = `<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
	<title>Image server</title>
	<style>
		.img-item{
			display:inline-block;
			max-width:400px;
			max-height:400px;
		}
		.img-item-img{
			display:inline-block;
			max-width:100%;
			max-height:80%;
			font-size:18px;
		}
		.img-item-name{
			display:inline-block;
			max-width:100%;
			max-height:20%;
			font-size:18px;
		}
	</style>
</head>
<body>
	<h1>当前目录 ${ROOT_DIR}{{.CurDir}}<h2>
	<div>
		<h2>子目录目录</h2>
		<ul class="dir-list">
			{{range .DirItems}}
			<li class="dir-item">
				<a href="{{.URL}}">{{.Name}}</a>
			</li>
			{{end}}
		</ul>
	</div>
	<div>
		<h2>其余文件</h2>
		<ul class="other-list">
			{{range .OtherItems}}
			<li class="other-item">
				<a href="{{.URL}}">{{.Name}}</a>
			</li>
			{{end}}
		</ul>
	</div>
	<div>
		<h2>当前目录图片</h2>
		<ul class="img-list">
			{{range .ImgItems}}
			<li class="img-item">
				<a href="{{.URL}}">
					<img class="img-item-img" src="{{.URL}}" alt="{{.Name}}"></img>
					<p class="img-item-name">{{.Name}}</p>
				</a>
			</li>
			{{end}}
		</ul>
	</div>
</body>
</html>
`
)
